<template>
    <div class="bg">

        <!-- 背景动画 -->
        <div class="area">
            <ul class="circles">
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
        <!-- <div class="bg-bottom">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23862.svg"
                alt="">
        </div>
        <div class="bg-bottom">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23863.svg"
                alt="">
        </div>
        <div class="bg-bottom">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23864.svg"
                alt="">
        </div> -->
        <div class="circle-first">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23865.svg"
                alt="">
        </div>
        <div class="circle-second">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23865.svg"
                alt="">
        </div>
        <div class="circle-thirdly">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23867.svg"
                alt="">
        </div>
        <div class="circle-fourthly">
            <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23870.svg"
                alt="">
        </div>
        <div class="login" v-show="changes">
            <div class="left-login">
                <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/__2323_u23909.png"
                    alt="">
            </div>
            <div class="right-login">
                <h2>XXXXX智慧社区/小区</h2>
                <p>物业信息管理平台</p>
                <el-tabs v-model="activeName" @tab-click="handleClick" class="ipt-box">
                    <el-tab-pane label="账号登录" name="first">
                        <div class="ipt">
                            <el-input placeholder="请输入账号" v-model="userIpt" clearable></el-input>
                        </div>
                        <div class="ipt">
                            <el-input placeholder="请输入登录密码" v-model="pwdIpt" show-password></el-input>
                        </div>
                        <div class="code">
                            <div class="code-left">
                                <el-input v-model="codeIpt" :disabled="userIpt == '' || pwdIpt == ''"
                                    placeholder="请输入验证码"></el-input>
                            </div>
                            <div class="code-right" @click="generateCaptcha">
                                <canvas id="captcha-canvas" width="150" height="42"></canvas>
                            </div>
                        </div>
                    </el-tab-pane>
                    <el-tab-pane label="验证码登录" name="second">
                        <div class="ipt">
                            <el-input placeholder="请输入手机号" v-model="phoneIpt" clearable></el-input>
                        </div>
                        <div class="ipt code-ipt">
                            <el-input placeholder="请输入验证码" v-model="phoneCode" clearable
                                :disabled="codeIsDisabled"></el-input>
                            <div class="getCode">
                                <span @click="codeLogin">{{ codeText ? '获取验证码' : countdown + 's后重新获取' }}</span>
                            </div>
                        </div>
                    </el-tab-pane>
                </el-tabs>
                <div class="agreement">
                    <input type="checkbox" :checked="isSelect" @change="select">
                    <span>已阅读智慧小区平台</span>
                    <span>《隐私权政策》</span>
                </div>
                <div class="login-btn" @click="login">登录</div>
                <div class="forgetPwd" @click="changes = false">
                    忘记密码?
                </div>
            </div>
        </div>
        <div v-show="!changes" class="login forget">
            <div class=" forget-left">
                <img src="https://cdn7.axureshop.com/demo2024/2178128/images/%E7%89%A9%E4%B8%9A%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0%E7%99%BB%E5%BD%95/u23923.png"
                    alt="">
            </div>
            <div class="forget-rihgt">
                <p class="forget-title">重置密码</p>
                <div class="forget-content">
                    <el-form ref="forgetForm" :model="forgetForm" label-width="80px" :rules="rules">
                        <el-form-item label="手机号">
                            <el-input v-model="forgetForm.phone"></el-input>
                        </el-form-item>
                        <el-form-item label="验证码" class="forget-code" prop="code">
                            <el-input v-model="forgetForm.code" :disabled="isDisabled"></el-input>
                            <p @click="getCode">{{ code ? '获取验证码' : countdown + 's后重新获取' }}</p>
                        </el-form-item>
                        <el-form-item label="新密码" prop="pass">
                            <el-input type="password" v-model="forgetForm.pass" autocomplete="off"></el-input>
                        </el-form-item>
                        <el-form-item label="确认密码" prop="checkPass">
                            <el-input type="password" v-model="forgetForm.checkPass" autocomplete="off"></el-input>
                        </el-form-item>
                        <el-form-item class="forget-btn">
                            <el-button type="primary" @click="submitForm('forgetForm')">提交</el-button>
                            <p class="goLogin"><span @click="goLogin">返回登录</span></p>
                        </el-form-item>
                    </el-form>
                </div>
            </div>
        </div>
        <svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
            viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
            <defs>
                <path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
            </defs>
            <g class="parallax">
                <use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.2)" />
                <use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.3)" />
                <use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.4)" />
                <use xlink:href="#gentle-wave" x="48" y="7" fill="rgba(255,255,255,0.5)" />
            </g>
        </svg>
    </div>
</template>

<script>
import { Base64 } from 'js-base64';  // 引入 Base64 模块
export default {

    data() {
        var validatePass = (rule, value, callback) => {
            if (value === '') {
                callback(new Error('请输入密码'));
            } else {
                if (this.forgetForm.checkPass !== '') {
                    this.$refs.forgetForm.validateField('checkPass');
                }
                callback();
            }
        };
        var validatePass2 = (rule, value, callback) => {
            if (value === '') {
                callback(new Error('请再次输入密码'));
            } else if (value !== this.forgetForm.pass) {
                callback(new Error('两次输入密码不一致!'));
            } else {
                callback();
            }
        };
        return {
            codeIsDisabled: true,
            tabIndex: 0,
            codeText: true,
            changes: true,
            activeName: 'first',
            userIpt: '',
            pwdIpt: '',
            codeIpt: '',
            phoneIpt: '',
            phoneCode: '',
            code: true,
            countdown: 60,
            //复选框
            isSelect: false,
            //随机验证码
            randomCode: '',
            timer: null,  // 用来存储定时器
            //获取验证码是否可用
            isDisabled: true,
            forgetForm: {
                phone: '',
                code: '',
                pass: '',
                checkPass: "",
            },
            rules: {
                pass: [
                    { validator: validatePass, trigger: 'blur' }
                ],
                checkPass: [
                    { validator: validatePass2, trigger: 'blur' }
                ],
                code: [
                    {
                        required: true, message: "请输入验证码", trigger: 'blur'
                    }
                ]
            },
        };
    },
    methods: {
        //通过验证码登录
        throughCode(phone, code) {
            this.$axios.post('http://127.0.0.1/employee/codeLogin', {
                phone,
                code
            },).then(res => {
                if (res.data.msg) {
                    this.$message({
                        message: res.data.msg,
                        type: 'error',
                        center: true
                    });
                    return
                }
                this.$message({
                    message: '登录成功',
                    type: 'success',
                    center: true
                });
                localStorage.setItem('token', res.data[0])
                localStorage.setItem('name', res.data[1])
                localStorage.setItem('id', res.data[2])
                this.$router.push({
                    path: this.$route.query.returnUrl || '/index'
                })

            }).catch(err => {
                console.log(err);
            })
        },
        //验证码登录
        codeLogin() {
            if (this.countdown != 60) {
                return;
            }
            if (!this.phoneIpt) {
                this.$message({
                    message: '请输入手机号',
                    type: 'error',
                    center: true
                });
                return
            }
            this.codeIsDisabled = false
            this.codeText = false
            this.setCode(this.phoneIpt)
            this.timer = setInterval(() => {
                if (this.countdown > 0) {
                    this.countdown -= 1;
                } else {
                    clearInterval(this.timer);
                    this.codeText = true;
                    this.countdown = 60;
                    this.timer = null;  // 清空定时器
                }
            }, 1000)
        },
        goLogin() {
            this.changes = true
            this.generateCaptcha()
        },
        setCode(phone) {
            this.$axios.post('http://127.0.0.1/employee/getCode', {
                phone
            }).then(res => {
                if (res.data.msg) {
                    this.$message({
                        message: res.data.msg,
                        type: 'error',
                        center: true
                    });
                    this.timer = null
                    this.countdown = 60,
                        this.codeText = true
                    return
                }
                this.$message({
                    message: res.data.success,
                    type: 'success',
                    center: true
                });

            }).catch(err => {
                console.log(err);
            })
        },
        //通过手机号更改密码
        forgetPwd() {
            this.$axios.post('http://127.0.0.1/employee/forgetPwd', {
                ...this.forgetForm
            }, {
                headers: {
                    'Authorization': `Bearer ${localStorage.getItem('token')}`,
                    'Content-Type': 'application/json' // 如果需要发送 JSON 数据，则包含此行 // 设置请求头
                }
            }).then(res => {
                if (res.data.msg) {
                    this.$message({
                        message: res.data.msg,
                        type: 'error',
                        center: true
                    });
                    return
                }
                this.$message({
                    message: res.data.success,
                    type: 'success',
                    center: true
                });
            }).catch(err => {
                console.log(err);
            })
        },
        getCode() {
            if (this.countdown != 60) {
                return;
            }
            if (!this.forgetForm.phone) {
                this.$message({
                    message: '请输入手机号',
                    type: 'error',
                    center: true
                });
                return
            }
            this.isDisabled = false
            this.code = false
            this.setCode(this.forgetForm.phone)
            this.timer = setInterval(() => {
                if (this.countdown > 0) {
                    this.countdown -= 1;
                } else {
                    clearInterval(this.timer);
                    this.code = true;
                    this.countdown = 60;
                    this.timer = null;  // 清空定时器
                }
            }, 1000)
        },
        clearTimer() {
            if (this.timer) {
                clearInterval(this.timer);  // 清除定时器
                this.timer = null;  // 清空定时器
            }
        },
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.forgetPwd()
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },

        reset() {
            this.userIpt = '',
                this.pwdIpt = '',
                this.codeIpt = '',
                this.generateCaptcha()
        },
        select() {
            this.isSelect = !this.isSelect
        },
        //用户验证
        user(name, pwd) {
            fetch('http://127.0.0.1/login', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({
                    name,
                    pwd: Base64.encode(pwd)
                })
            }).then(res => res.json()).then(res1 => {
                if (res1.msg) {
                    this.$message({
                        message: res1.msg,
                        type: 'error',
                        center: true
                    });
                    return
                }
                this.$message({
                    message: '登录成功',
                    type: 'success',
                    center: true,
                    center: true
                });
                // this.$router.replace('/index/workbench')
                localStorage.setItem('token', res1[0])
                localStorage.setItem('name', res1[1])
                localStorage.setItem('id', res1[2])
                this.$router.push({
                    path: this.$route.query.returnUrl || '/index'
                })
            }).catch(err => {
                this.$message({
                    message: '账号不存在,请重新输入',
                    type: 'error',
                    center: true
                });
                // this.reset()
            })
        },
        resetCode() {
            this.phoneIpt = ''
            this.phoneCode = ''
        },
        //点击登录按钮
        login() {
            // 判断是验证码登录 还是密码登录
            if (this.tabIndex==1) {     
                //验证码登录
                if (this.phoneIpt == '' || this.phoneCode == '') {
                    this.$message({
                        message: '手机号或验证码不能为空',
                        type: 'warning',
                        center: true
                    });
                    this.resetCode()
                    return
                }
                if (!this.isSelect) {
                    this.$message({
                        message: '请阅读用户隐私政策',
                        type: 'warning',
                        center: true
                    });
                    return
                }
                this.throughCode(this.phoneIpt, this.phoneCode)
                return
            }
         
            if (this.userIpt == '' || this.pwdIpt == '') {
                this.$message({
                    message: '账号或密码不能为空',
                    type: 'warning',
                    center: true
                });
                this.reset()
                return
            }
            if (this.codeIpt == '') {
                this.$message({
                    message: '验证码为空,请重新输入',
                    type: 'warning',
                    center: true
                });
                this.generateCaptcha()
                return
            }
            if (this.codeIpt.includes(this.randomCode)) {
                this.$message({
                    message: '验证码输入有误,请重新输入',
                    type: 'warning',
                    center: true
                });
                this.generateCaptcha()
                this.codeIpt = ''
                return
            }
            if (!this.isSelect) {
                this.$message({
                    message: '请阅读用户隐私政策',
                    type: 'warning',
                    center: true
                });
                return
            }
            this.user(this.userIpt, this.pwdIpt)
            // if (this.userIpt == 'zhangsan' && this.pwdIpt == 123456) {
            //     this.$message({
            //         message: '登录成功',
            //         type: 'success',
            //         center: true
            //     });
            // } else {
            //     this.$message({
            //         message: '账号或密码错误,请重新输入',
            //         type: 'error',
            //         center: true
            //     });
            //     this.reset()

            // }
        },
        handleClick(tab) {
        
            this.tabIndex = tab.index
            
        },
        getRandomColor() {
            const letters = '0123456789ABCDEF';
            let color = '#';
            for (let i = 0; i < 6; i++) {
                color += letters[Math.floor(Math.random() * 16)];
            }
            return color;
        },
        generateCaptcha() {
            const canvas = document.getElementById('captcha-canvas');
            const ctx = canvas.getContext('2d');

            // Clear the canvas
            ctx.clearRect(0, 0, canvas.width, canvas.height);

            // Define characters and captcha length
            const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
            const captchaLength = 4;
            let captcha = '';

            // Generate random captcha text and colors
            for (let i = 0; i < captchaLength; i++) {
                const randomIndex = Math.floor(Math.random() * characters.length);
                captcha += characters[randomIndex];
            }
            this.randomCode = captcha

            // Draw captcha text on canvas with random colors
            ctx.font = '24px Arial';
            ctx.textBaseline = 'middle';

            for (let i = 0; i < captcha.length; i++) {
                ctx.save();

                // Random position for each character (simple centering)
                const x = (i + 1) * (canvas.width / (captcha.length + 1)) - 12; // Adjust -12 to center better
                const y = canvas.height / 2;

                // Random rotation
                const angle = Math.random() * 15 - 7.5;
                ctx.translate(x, y);
                ctx.rotate(angle * Math.PI / 180);
                // Random color
                ctx.fillStyle = this.getRandomColor();

                // Draw the character
                ctx.fillText(captcha[i], 0, 0);

                ctx.restore();
            }
        }
    },
    beforeDestroy() {
        this.clearTimer();  // 确保在组件销毁时清除定时器
    },
    mounted() {
        this.generateCaptcha()
    }
};
</script>

<style scoped>
.goLogin span {
    cursor: pointer;
    user-select: none;
}

.goLogin {
    font-size: 12px;
    color: #1a87fe;
    text-align: right;
}

.forget-code>>>.el-input {
    width: 150px;
    margin-right: 30px;
}

.forget-code p {
    font-size: 12px;
    color: #22a2f7;
    cursor: pointer;
}

.forget-code>>>.el-form-item__content {
    display: flex;
}

.forget-btn>>>button {
    width: 100%;
}

.forget-btn>>>.el-form-item__content {
    margin-left: 0 !important;
}

.forget {
    align-items: center;
}

.forget-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 40px;
}

.forget-left img {
    width: 236px;
    height: 135px;
}

.forget-rihgt {
    width: 400px;
}

.forget-left {
    width: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    /* margin-bottom:-7px; Fix for safari gap */
    min-height: 100px;
    max-height: 150px;
}


/* Animation */

.parallax>use {
    animation: move-forever 25s cubic-bezier(.55, .5, .45, .5) infinite;
}

.parallax>use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 7s;
}

.parallax>use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 10s;
}

.parallax>use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 13s;
}

.parallax>use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 20s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }

    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/*Shrinking for mobile*/
@media (max-width: 768px) {
    .waves {
        height: 40px;
        min-height: 40px;
    }

    .content {
        height: 30vh;
    }

    h1 {
        font-size: 24px;
    }
}

.circles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.circles li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    animation: animate 25s linear infinite;
    bottom: -150px;

}

.circles li:nth-child(1) {
    left: 25%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}


.circles li:nth-child(2) {
    left: 10%;
    width: 20px;
    height: 20px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.circles li:nth-child(3) {
    left: 70%;
    width: 20px;
    height: 20px;
    animation-delay: 4s;
}

.circles li:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-delay: 0s;
    animation-duration: 18s;
}

.circles li:nth-child(5) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

.circles li:nth-child(6) {
    left: 75%;
    width: 110px;
    height: 110px;
    animation-delay: 3s;
}

.circles li:nth-child(7) {
    left: 35%;
    width: 150px;
    height: 150px;
    animation-delay: 7s;
}

.circles li:nth-child(8) {
    left: 50%;
    width: 25px;
    height: 25px;
    animation-delay: 15s;
    animation-duration: 45s;
}

.circles li:nth-child(9) {
    left: 20%;
    width: 15px;
    height: 15px;
    animation-delay: 2s;
    animation-duration: 35s;
}

.circles li:nth-child(10) {
    left: 85%;
    width: 150px;
    height: 150px;
    animation-delay: 0s;
    animation-duration: 11s;
}



@keyframes animate {

    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }

    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }

}

.bg {
    position: relative;
    height: 100vh;
    background: linear-gradient(-54.940573033113deg, rgba(19, 202, 251, 1) 0%, rgba(24, 140, 249, 1) 31%, rgba(26, 118, 248, 1) 51%, rgba(51, 133, 249, 1) 100%);
}

.bg-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 188px;
}

.bg-bottom img {
    width: 100%;
    height: 100%;
}

.circle-first {
    width: 110px;
    height: 110px;
    position: absolute;
    left: 48px;
    top: 87px;
}

.circle-second {
    position: absolute;
    left: 777px;
    top: 314px;
    width: 41px;
    height: 41px;
}

.circle-thirdly {
    position: absolute;
    left: 720px;
    top: 69px;
    width: 35px;
    height: 35px;
}

.circle-fourthly {
    position: absolute;
    right: 84px;
    top: 44px;
    width: 96px;
    height: 96px
}

.ipt {
    width: 350px;
}

.code-left {
    width: 200px;
}

.code {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.ipt-box>>>.el-tabs__content {
    margin-top: 20px;
}

.code-right {
    background: #fff;
    height: 42px;
    cursor: pointer;
}

input {
    outline: none;
}

.ipt>>>input {
    border-top: 0;
    border-left: 0;
    border-right: 0;
    /* border: 0; */
    border-radius: 0;
    margin-top: 5px;
    height: 42px;
}

.code>>>input {
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    height: 42px;
}

.code-ipt {
    width: 248px;
}

.ipt>>>.el-input__icon {
    line-height: 52px;
}

.getCode {
    display: flex;
    align-items: center;
    border: 1px solid rgba(153, 153, 153, 1);
    /* width: 102px; */
    height: 35px;
    /* line-height: 35px; */
    text-align: center;
    border-radius: 50px;
    color: #1E1E1E;
    font-size: 12px;
    padding: 0 10px;
}

.getCode span {}

.code-ipt {
    display: flex;
    align-items: center;
    /* background: #fff; */
    /* justify-content: space-between; */
    width: 350px;
}

.code-ipt>>>.el-input {
    width: 200px;
    margin-right: 20px;
}

.left-login img {
    width: 466px;
    height: 452px;
}

.login {
    display: flex;
    width: 886px;
    height: 453px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0px 0px 20px rgba(51, 102, 255, 0.427450980392157);
    background-color: rgba(255, 255, 255, 1);
    border-radius: 5px;

}

.right-login h2 {
    font-size: 26px;
}

.right-login p {
    font-size: 18px;
    color: #949494;
    margin-bottom: 30px;
}

.right-login {
    background: #fff;
    padding-left: 30px;
    padding-top: 15px;
}

.left-login {
    background: linear-gradient(180deg, rgba(229, 251, 255, 1) 0%, rgba(33, 142, 244, 1) 100%);
    border-radius: 5px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
}

.agreement input {
    width: 12px;
    height: 12px;
    margin-right: 5px;
}

.agreement span {
    font-size: 12px;
    color: #409EFF;
}

.agreement {
    display: flex;
    align-items: center;
    margin-top: 40px;
    cursor: pointer;
}

.login-btn {
    width: 350px;
    height: 39px;
    background-color: rgba(0, 121, 254, 0.898039215686275);
    font-size: 16px;
    color: #FFFFFF;
    text-align: center;
    line-height: 39px;
    border-radius: 5px;
    margin-top: 20px;
    cursor: pointer;
}

.forgetPwd {
    font-size: 12px;
    color: #1A87FE;
    padding: 2px 2px 2px 2px;
    cursor: pointer;
}
</style>